package com.house.framework.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class ResultVo<T> implements Serializable {

    private String message = "操作成功";

    private Integer status = 0;

    private T data;

    public ResultVo() {
    }

    public ResultVo(String message) {
        this.message = message;
    }

    public ResultVo(String message, Integer status) {
        this.message = message;
        this.status = status;
    }

    public ResultVo(String message, Integer status, T data) {
        this.message = message;
        this.status = status;
        this.data = data;
    }

    public ResultVo(T data) {
        this.data = data;
    }

    public ResultVo(T data, String message) {
        this.data = data;
        this.message = message;
    }

    public static <T> ResultVo<T> dateOf(T data) {
        return new ResultVo<T>(data);
    }

    @ApiModelProperty("分页页码")
    @TableField(exist = false)
    private Integer pageIndex;

    @ApiModelProperty("每页记录条数")
    @TableField(exist = false)
    private Integer pageSize;
}
